package cn.crism.dto;

import cn.crism.model.SysDept;
import com.google.common.collect.Lists;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @CreateDate: 2018/12/13 5:01 PM
 * @Description:
 * @Author: Crism
 */

@Getter
@Setter
@ToString
public class DeptLevelDto extends SysDept {

    /* 下层列表 */
    private List<DeptLevelDto> deptList = Lists.newArrayList();

    /* 把SysDept转化成deptDto */
    public static DeptLevelDto adapt(SysDept dept){
        DeptLevelDto dto = new DeptLevelDto();
        BeanUtils.copyProperties(dept,dto);
        return dto;
    }
}
